package com.huitone.smspfm.core.config;

import java.util.HashMap;
import java.util.Map;

public abstract class AbstractConfigurationLoader implements ConfigurationLoader {

	private Map<Object, Object> configuration = null;
	
	public synchronized void setConfiguration(Object key, Object value) {
		
		if (configuration == null) configuration = new HashMap<>();
		
		configuration.put(key, value);
	}
	
	public synchronized Object getConfiguration(Object key) {
		
		if (configuration == null) return null;
		
		return configuration.get(key);
	}
	
	public void clearConfiguration() {
		
		if (configuration != null) {
			configuration.clear();
		}
	}
	
}
